package model.dbconnection;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import properties.MyTradeProps;

/**
 * Erstellt am 10.07.2013
 * @author Luca Christen
 */
public class ConnectionFactory {

	private static String connURL  = MyTradeProps.getPropertyText("db.path");
	private static String username = MyTradeProps.getPropertyText("db.username");
	private static String passwort = MyTradeProps.getPropertyText("db.passwort");
	
	private ConnectionFactory() {}
	
	public static Connection getConnection() {
		try {
			Class.forName("com.mysql.jdbc.Driver");
			return DriverManager.getConnection(connURL, username, passwort);
		} catch (SQLException | ClassNotFoundException e) {
			e.printStackTrace();
		} 
		return null;
	}
	
}
